#include "ventanaestadisticas.h"
#include "ui_ventanaestadisticas.h"
#include <QString>

VentanaEstadisticas::VentanaEstadisticas(QWidget *parent) :
        QWidget(parent), ui(new Ui::VentanaEstadisticas) {
    ui->setupUi(this);
    cantClientes[0] = ui->lCantCli1;
    cantClientes[1] = ui->lCantCli2;
    cantClientes[2] = ui->lCantCli3;
    cantClientes[3] = ui->lCantCli4;
    cantClientes[4] = ui->lCantCli5;
    cantClientes[5] = ui->lCantCli6;

    porcRetNot[0] = ui->lRetirosNot1;
    porcRetNot[1] = ui->lRetirosNot2;
    porcRetNot[2] = ui->lRetirosNot3;
    porcRetNot[3] = ui->lRetirosNot4;
    porcRetNot[4] = ui->lRetirosNot5;
    porcRetNot[5] = ui->lRetirosNot6;

    porcDep[0] = ui->lPorcDep1;
    porcDep[1] = ui->lPorcDep2;
    porcDep[2] = ui->lPorcDep3;
    porcDep[3] = ui->lPorcDep4;
    porcDep[4] = ui->lPorcDep5;
    porcDep[5] = ui->lPorcDep6;

    porcCon[0] = ui->lPorcCon1;
    porcCon[1] = ui->lPorcCon2;
    porcCon[2] = ui->lPorcCon3;
    porcCon[3] = ui->lPorcCon4;
    porcCon[4] = ui->lPorcCon5;
    porcCon[5] = ui->lPorcCon6;

    porcSer[0] = ui->lPorcSer1;
    porcSer[1] = ui->lPorcSer2;
    porcSer[2] = ui->lPorcSer3;
    porcSer[3] = ui->lPorcSer4;
    porcSer[4] = ui->lPorcSer5;
    porcSer[5] = ui->lPorcSer6;

    porcRet[0] = ui->lPorcRet1;
    porcRet[1] = ui->lPorcRet2;
    porcRet[2] = ui->lPorcRet3;
    porcRet[3] = ui->lPorcRet4;
    porcRet[4] = ui->lPorcRet5;
    porcRet[5] = ui->lPorcRet6;

    ingresos[0] = ui->lIngreso1;
    ingresos[1] = ui->lIngreso2;
    ingresos[2] = ui->lIngreso3;
    ingresos[3] = ui->lIngreso4;
    ingresos[4] = ui->lIngreso5;
    ingresos[5] = ui->lIngreso6;

    egresos[0] = ui->lEgreso1;
    egresos[1] = ui->lEgreso2;
    egresos[2] = ui->lEgreso3;
    egresos[3] = ui->lEgreso4;
    egresos[4] = ui->lEgreso5;
    egresos[5] = ui->lEgreso6;

}

VentanaEstadisticas::~VentanaEstadisticas() {
    delete ui;
}

void VentanaEstadisticas::setCantClientes(int i, int valor) {
    cantClientes[i]->setText(QString::number(valor));
}

void VentanaEstadisticas::setPorcRetNot(int i, float valor) {
    porcRetNot[i]->setText(QString::number(valor) + "%");
}


void VentanaEstadisticas::setPorcDep(int i, float valor) {
    porcDep[i]->setText(QString::number(valor) + "%");
}


void VentanaEstadisticas::setPorcCon(int i, float valor) {
    porcCon[i]->setText(QString::number(valor) + "%");
}

void VentanaEstadisticas::setPorcSer(int i, float valor) {
    porcSer[i]->setText(QString::number(valor) + "%");
}

void VentanaEstadisticas::setPorcRet(int i, float valor) {
    porcRet[i]->setText(QString::number(valor) + "%");
}

void VentanaEstadisticas::setIngreso(int i, float  valor) {
    ingresos[i]->setText(QString::number(valor) + " Bs.");
}

void VentanaEstadisticas::setEngreso(int i, float valor) {
    egresos[i]->setText(QString::number(valor) + " Bs.");
}
